import xlrd
import pyecharts.options as opts
data=xlrd.open_workbook(r'C:\Users\chumenliuxiang\Desktop\实验室作业\第一问\第一问.xls','r')
sheet_num=data.nsheets
# print(sheet_num)
biao1=data.sheet_by_name('Sheet1')
# print(biao1)
hours=biao1.col_values(0)
hours=hours[1:]
# print(hours)
#——————————————————————数据处理完毕

from pyecharts import options as opts
from pyecharts.charts import Boxplot

v1 = [hours]
c =(Boxplot()
    .add_xaxis(["student"])
    .add_yaxis("hours", Boxplot().prepare_data(v1))
    .set_global_opts(title_opts=opts.TitleOpts(title="学习时长的线箱图",pos_left='center',pos_bottom='1%'))
    .render("第四问.html")
    )